<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-4.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head>
    <head th:include="common/global :: global('订单列表','css','admin/order/getOrderList')">

    </head>
<body>
<style type="text/css">
    table {
        table-layout: fixed; /* 只有定义了表格的布局算法为fixed，下面td的定义才能起作用。 */
    }

    td {
        width: 100%;
        word-break: keep-all; /* 不换行 */
        white-space: nowrap; /* 不换行 */
        overflow: hidden; /* 内容超出宽度时隐藏超出部分的内容 */
        text-overflow: ellipsis; /* 当对象内文本溢出时显示省略标记(...) ；需与overflow:hidden;一起使用。*/
    }
</style>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 订单 <span
        class="c-gray en">&gt;</span> 订单管理 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px"
                                              href="javascript:location.replace(location.href);" title="刷新"><i
        class="Hui-iconfont">&#xe68f;</i></a></nav>
<div class="page-container">
    <div class="text-c">
        <form action="/admin/order/getOrderList" method="post" id="searchForm">
            <input type="hidden" id="count" th:value="${pageInfo?.total }"/>
            <input type="hidden" id="page" name="page" th:value="${pageInfo?.pageNum }"/>
            <input type="hidden" id="pageSize" name="pageSize" th:value="${pageInfo?.pageSize }"/>

            <input type="text" name="orderId" th:value="${orderId }" placeholder=" 请输入你要查询的订单号" style="width:250px"
                   class="input-text">
            <span>状态：</span>
            <span class="select-box inline">
                <select name="status" class="select">
                    <option value="" th:selected="${status==''}">--全部--</option>
                    <option value="2" th:selected="${status==2}">已支付</option>
                    <option value="1" th:selected="${status==1}">未支付</option>
                    <option value="6" th:selected="${status==13}">已发货</option>
                    <option value="6" th:selected="${status==9}">交易成功</option>
                </select>
            </span>
            <button name="" class="btn btn-success" type="submit"><i class="Hui-iconfont">&#xe665;</i> 搜索</button>
        </form>
    </div>
    <div class="mt-20 portfolio-content">
        <table class="table table-border table-bordered table-bg table-hover table-sort">
            <thead>
            <tr class="text-c">
                <th width="25%">订单号</th>
                <th width="25%">价格</th>
                <th width="25%">收货信息</th>
                <th width="25%">订单详情</th>
                <th width="25%">支付方式</th>
                <th width="25%">订单时间</th>
                <th width="10%">状态</th>
                <th width="10%">操作</th>
            </tr>
            </thead>
            <tbody>
            <tr class="text-c" th:each="item:${pageInfo.list}">
                <td th:text="${item.orderId }">

                </td>

                <td th:text="${'￥'+#numbers.formatDecimal(item?.orderPrice/100.0, 1, 2)}">


                </td>
                <td>
                    <span th:text="${'姓名：'+item?.consigneeInfo?.consigneeName }"></span>  </br>
                    <span th:text="${'电话：'+item?.consigneeInfo?.consigneePhone }">电话：</span>    </br>
                    <span th:text="${'地址：'+item?.consigneeInfo?.consigneeAddress }">地址：</span>  </br>


                </td>
                <td>
                    <ul th:each="orderItem:${item.orderItemList}">
                        <li th:text="${orderItem.productEntity.name+':'+orderItem.amount}"></li>
                    </ul>
                </td>

                <td  >
                    <ul th:each="payment:${item.paymentList}">
                        <li th:text="${payment.payMode==6?'微信支付':payment.payMode==9?'后台支付':''}"></li>
                    </ul>
                </td>
                <td th:text="${#dates.format(item.createTime, 'yyyy-MM-dd HH:mm')}">

                </td>
                <td class="td-status" th:text="${item.status==-2?'已删除':item.status==-1?'已过期':item.status==0?'已取消':item.status==1?'未支付':item.status==2?'已支付':item.status==5?'交易完成':item.status==9?'交易成功':item.status==12?'待发货':item.status==13?'已发货':''}">
                    <!--              <c:if test="${item.status==-2}">已删除</c:if>
                                  <c:if test="${item.status==-1}">已过期</c:if>
                                  <c:if test="${item.status==0}">已取消</c:if>
                                  <c:if test="${item.status==1}">未支付</c:if>
                                  <c:if test="${item.status==2}">已支付</c:if>
                                  <c:if test="${item.status==6}">申请退款</c:if>
                                  <c:if test="${item.status==8}">已退款</c:if>
                                  <c:if test="${item.status==7}">取消退款</c:if>
                                  <c:if test="${item.status==3}">未验证</c:if>
                                  <c:if test="${item.status==4}">已验证</c:if>
                                  <c:if test="${item.status==5}">交易完成</c:if>
                                  <c:if test="${item.status==9}">订单关闭</c:if>
                                  <c:if test="${item.status==10}">部分支付</c:if>
                                  <c:if test="${item.status==11}">支付失败订单关闭</c:if>
                                  <c:if test="${item.status==12}">待发货</c:if>
                                  <c:if test="${item.status==13}">已发货</c:if>
                                  <c:if test="${item.status==14}">已收货</c:if>-->
                </td>
              <td >

                  <a style="text-decoration:none" class="ml-5" th:onClick="'shipments('+${item.orderId}+')'"
                     href="javascript:void(0);" title="发货" th:if="${item.status==2}"><i class="Hui-iconfont">&#xe669;</i></a>

                </td>
            </tr>
            </tbody>
        </table>
        <div th:replace="common/include-footer"></div>
    </div>
</div>
</body>
</html>